// pages/mine_center/caips_appiontment/appiontment.js
const app = getApp();
var request = require("../../../utils/request.js");
var wx_alert = require("../../../utils/wx_alert.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    weekdays:[
     
    ],
    days:[
    ],
    selected_day:"1000",
    select_time:"false",
    shooting_time:[

    ],
    first_date:"",
    show_have: true,
    show: true,         
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //快捷导航跳转
    this.turn = request.turn;
    this.close_modal = request.close_modal;
    var that = this;
    this.setData({
      options: options
    })
    
    request.request(app.globalData.getScheduleDetail, { orderId: options.order_id},function(res){
      console.log(res)
      if(res.code == 0){
         that.setData({
           content:res
         })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
 
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  selected_day:function(e){
    var index = e.currentTarget.dataset.index;
    var days = this.data.days;
    this.setData({
      selected_day:index,
      end_day: days[index].day,
      end_week:days[index].weekday
    }) 
  },
  select_time:function(e){
    var index = e.currentTarget.dataset.index;   
    var shooting_time = this.data.shooting_time;
    this.setData({
      select_time:index,
      end_time: shooting_time[index].time
    }) 
  },
  sure_click:function(){
    wx.navigateTo({
      url: '/pages/mine_center/caips_shop/shop',
    })
  },
  wen_click: function () {
    var show = this.data.show;
    show = !show;
    this.setData({
      show: show
    })
  },
  revise_time: function () {
    wx.redirectTo({
      url: '/pages/mine_center/modify_time/modify_time?order_id=' + this.data.options.order_id + '&storeId=' + this.data.options.store_id,
    })
  }  
})